﻿using HB.Base;
using System;
using System.Threading;
using Newtonsoft.Json;
public delegate void msg(string msg);
namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            //JsonConvert.SerializeObject
            //IOCTest ioc = new IOCTest();
            //return;
            //NatTest ttt = new NatTest();


            //Console.Read();
            //TaskTest tt = new TaskTest();


            //PulseTest pt = new PulseTest();
            //Console.Read();
            AverageSpeed aspp = new AverageSpeed(4);
            aspp.OnSpeedChanged += (s) =>
            {
                Console.WriteLine(s.ToString());
            };
            TriggerTimer tt2 = new TriggerTimer();
            int iy = 0;
            tt2.Start(2000, (t, i) =>
            {
                iy += 1;
                aspp.Log();
            });
            Console.ReadLine();

            System.Timers.Timer tfeq = new System.Timers.Timer();
            tfeq.Interval = 1000;
            tfeq.Elapsed += (a, b) =>
            {
                Console.WriteLine(tt2.SpeedHZ);
            };
            tfeq.Start();
            Console.ReadLine();
            tt2.Stop();
            Console.WriteLine(iy);
            Console.ReadLine();

        }

    }
}
